#include <stdio.h>

typedef struct _tree {
	int		weight;
	char 		symbol;
	struct _tree	*left, *right;
} node;

typedef struct tree{
	node	root;
} tree_t

tree_t	my_tree;

node get_parent( node n , tree_t t )
{
	node root = t.root;
	if( root->left == n )
	{
		return root->left;
	}
	if( root->right == n )
	{
		return root->right;
	}
	if( root->right == null && root->left == null )
	{
		return null;
	}
	node result_left = get_parent( n , root->left );
	node result_right = get_parent( n , root->right);
	if( result_left != null)
		return result_left;
	if( result_right != null ) 
		return result_right;
	return null;
}
